import { BrowserRouter, NavLink, Navigate, Route, Routes } from "react-router-dom"
import "./App.css"
import { Suspense, lazy } from "react"

import GetRoutes from "./router/index"

const App=()=>{
  return (
    // 指定路由模式
    <BrowserRouter>

      <NavLink to={"/home"} className={({isActive})=>(isActive?"green":'')}>跳转到home页面</NavLink>
      <NavLink to={"/about"} className={({isActive})=>(isActive?"green":'')}>跳转到about页面</NavLink>

      <Suspense fallback={<p>正在加载中。。。</p>}>
        <GetRoutes/>
      </Suspense>
    </BrowserRouter>
  )
}

export default App